package com.reins.bookstore.object;
import lombok.Data;

import java.math.BigDecimal;
import java.sql.Date;

@Data
public class UserRate {
    private Integer Rate;
    private UserDTO user;
    private BigDecimal cost;
    public UserRate(Integer Rate, UserDTO user_dto,BigDecimal cost){
        this.Rate = Rate;
        this.user = user_dto;
        this.cost = cost;
    }
    public UserRate(UserDTO user_dto,BigDecimal cost){
        this.Rate = 0;
        this.user = user_dto;
        this.cost = cost;
    }
    public UserRate(UserDTO user_dto){
        Rate =  0;
        cost = new BigDecimal(0);
        this.user = user_dto;
    }

    public void setRate(Integer rate) {
        Rate = rate;
    }
    public void addCost(BigDecimal add){
        cost = cost.add(add);
    }
}
